import React from 'react';
import { Typography } from 'antd';
import { IUiApi } from 'umi-types'

const { Title, Paragraph, Text } = Typography;

export default (api: IUiApi) => {

  function PluginPanel() {
    return (
      <div style={{ padding: 20 }}>
        <Typography>
          <Title level={2}>OSS文件上传插件</Title>
          <Paragraph>
            使用该插件可在项目构建完成后自定上传资源文件至CDN服务
          </Paragraph>
          <Paragraph>
          <ul>
            <li>
              <span><Text code>ossConfig</Text>oss相关配置</span>
            </li>
            <li>
              <span><Text code>uploadPath</Text>文件上传路径</span>
            </li>
            <li>
              <span><Text code>cdnPrefix</Text>上传文件使用cdn地址</span>
            </li>
            <li>
              <span><Text code>ignoreHtml</Text>忽略上传html文件</span>
            </li>
            <li>
              <span><Text code>include</Text>上传指定文件</span>
            </li>
            <li>
              <span><Text code>exclude</Text>忽略上传匹配文件</span>
            </li>
            <li>
              <span><Text code>removeFinished</Text>是否删除上传成功的文件</span>
            </li>
            <li>
              <span><Text code>keepFile</Text>保留文件正则，仅在删除时有效</span>
            </li>
          </ul>
        </Paragraph>
        </Typography>
      </div>
    );
  }

  api.addPanel({
    title: 'umi-plugin-alioss',
    path: '/umi-plugin-alioss',
    icon: 'gift',
    component: PluginPanel,
  });
}
